<?php
$this->Paginator->options(array(
    'url' => $productCategoriesTableURL,
    'update' => '.productCategories.table',
    'evalScripts' => true
));?>
<table class="table table-striped">
<tr>
	<th><?php echo $this->Paginator->sort('category_name', __d('admin', 'category_name'), array('model' => $productCategoriesTableModelAlias));?></th>
	<th><?php echo $this->Paginator->sort('category_image', __d('admin', 'category_image'), array('model' => $productCategoriesTableModelAlias));?></th>
	<th><?php echo $this->Paginator->sort('ProductBrand.brand_name', __d('admin', 'brand'), array('model' => $productCategoriesTableModelAlias));?></th>
    <th class="actions"><?php echo __d('admin', 'Actions');?></th>
</tr>
<?php
foreach ($productCategories as $productCategory): ?>
	<tr>
		<td><?php echo h($productCategory[$productCategoriesTableModelAlias]['category_name']); ?>&nbsp;</td>
		<td><img src="/files/images/<?php echo h($productCategory[$productCategoriesTableModelAlias]['category_image']); ?>" height="100">&nbsp;</td>
		<td><?php echo h($productCategory['ProductBrand']['toString']); ?>&nbsp;</td>
		<td class="actions">
			<?php //echo $this->Html->link(__d('admin', 'View'), array('plugin' => 'admin', 'controller' => 'admin_product_categories', 'action' => 'view', $productCategory[$productCategoriesTableModelAlias]['id']), array('class' => 'btn btn-info btn-xs')); ?>
			<?php echo $this->Html->link(__d('admin', 'Edit'), array('plugin' => 'admin', 'controller' => 'admin_product_categories', 'action' => 'edit', $productCategory[$productCategoriesTableModelAlias]['id'], '?' => array('redirect' => $redirectUrl)), array('class' => 'btn btn-info btn-xs')); ?>
			<?php echo $this->Form->postLink(__d('admin', 'Delete'), array('plugin' => 'admin', 'controller' => 'admin_product_categories', 'action' => 'delete', $productCategory[$productCategoriesTableModelAlias]['id'], '?' => array('redirect' => $redirectUrl)), array('class' => 'btn btn-danger btn-xs'), __d('admin', 'Are you sure you want to delete # %s?', $productCategory[$productCategoriesTableModelAlias]['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>

<?php if($this->Paginator->counter('{:pages}') > 1) :?>
<div>
    <ul class="pagination">
<?php
		echo '<li>' . $this->Paginator->prev('Prev', array('model' => $productCategoriesTableModelAlias), null, array('class' => 'prev disabled')) . '</li>';
		echo $this->Paginator->numbers(array('separator' => '', 'tag' => 'li', 'currentTag' => 'span', 'currentClass' => 'active', 'model' => $productCategoriesTableModelAlias));
		echo '<li>' . $this->Paginator->next('Next', array('model' => $productCategoriesTableModelAlias), null, array('class' => 'next disabled')) . '</li>';
	?>
    </ul>
</div>
<?php endif;?>